﻿using University.Workshop.Model.LogicalWinner;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace University.Workshop.Tests
{
    
    
    /// <summary>
    ///This is a test class for HandTest and is intended
    ///to contain all HandTest Unit Tests
    ///</summary>
    [TestClass()]
    public class HandTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion

        /*
        /// <summary>
        ///A test for OnePair
        ///</summary>
        [TestMethod()]
        public void OnePairTest()
        {
            Hand target = new Hand(); // TODO: Initialize to an appropriate value
            string expected = string.Empty; // TODO: Initialize to an appropriate value
            string actual;
            actual = target.OnePair();
            Assert.AreEqual(expected, actual);
            //Assert.Inconclusive("Verify the correctness of this test method.");
        }*/

        /// <summary>
        ///A test for OnePair
        ///</summary>
        [TestMethod()]
        public void OnePairTest()
        {
            Hand target = new Hand();// TODO: Initialize to an appropriate value
            target.CardsOfHand[0].NumberOfCard = 1;
            target.CardsOfHand[1].NumberOfCard = 2;
            target.CardsOfHand[2].NumberOfCard = 3;
            target.CardsOfHand[3].NumberOfCard = 4;
            target.CardsOfHand[4].NumberOfCard = 5;
            target.CardsOfHand[5].NumberOfCard = 1;
            target.Mayor1 = 1;
            target.Mayor2 = 4;

            target.CardsOfHand[0].TypeOfCard = "d";
            target.CardsOfHand[1].TypeOfCard = "d";
            target.CardsOfHand[2].TypeOfCard = "c";
            target.CardsOfHand[3].TypeOfCard = "t";
            target.CardsOfHand[4].TypeOfCard = "d";
            target.CardsOfHand[5].TypeOfCard = "t";
            string expected = "15 "+ 1; // TODO: Initialize to an appropriate value
            string actual;
            actual = target.OnePair();
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for twoPair
        ///</summary>
        [TestMethod()]
        [DeploymentItem("University.Workshop.Model.dll")]
        public void twoPairTest()
        {
            Hand_Accessor target = new Hand_Accessor(); // TODO: Initialize to an appropriate value
            target.CardsOfHand[0].NumberOfCard = 1;
            target.CardsOfHand[1].NumberOfCard = 2;
            target.CardsOfHand[2].NumberOfCard = 2;
            target.CardsOfHand[3].NumberOfCard = 4;
            target.CardsOfHand[4].NumberOfCard = 5;
            target.CardsOfHand[5].NumberOfCard = 1;
            target.Mayor1 = 2;
            target.Mayor2 = 5;

            target.CardsOfHand[0].TypeOfCard = "d";
            target.CardsOfHand[1].TypeOfCard = "d";
            target.CardsOfHand[2].TypeOfCard = "c";
            target.CardsOfHand[3].TypeOfCard = "t";
            target.CardsOfHand[4].TypeOfCard = "d";
            target.CardsOfHand[5].TypeOfCard = "t";
            string expected = "16 "+2; // TODO: Initialize to an appropriate value
            string actual;
            actual = target.twoPair();
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for threeOfDeKing
        ///</summary>
        [TestMethod()]
        [DeploymentItem("University.Workshop.Model.dll")]
        public void threeOfDeKingTest()
        {

            Hand_Accessor target = new Hand_Accessor(); // TODO: Initialize to an appropriate value
            target.CardsOfHand[0].NumberOfCard = 12;
            target.CardsOfHand[1].NumberOfCard = 2;
            target.CardsOfHand[2].NumberOfCard = 2;
            target.CardsOfHand[3].NumberOfCard = 2;
            target.CardsOfHand[4].NumberOfCard = 5;
            target.CardsOfHand[5].NumberOfCard = 1;
            target.Mayor1 = 2;
            target.Mayor2 = 5;

            target.CardsOfHand[0].TypeOfCard = "d";
            target.CardsOfHand[1].TypeOfCard = "d";
            target.CardsOfHand[2].TypeOfCard = "c";
            target.CardsOfHand[3].TypeOfCard = "t";
            target.CardsOfHand[4].TypeOfCard = "d";
            target.CardsOfHand[5].TypeOfCard = "t";
            string expected = "17 "+2; // TODO: Initialize to an appropriate value
            string actual;
            actual = target.threeOfDeKing();
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for straight
        ///</summary>
        [TestMethod()]
        [DeploymentItem("University.Workshop.Model.dll")]
        public void straightTest()
        {
            Hand_Accessor target = new Hand_Accessor(); // TODO: Initialize to an appropriate value
            target.CardsOfHand[0].NumberOfCard = 1;
            target.CardsOfHand[1].NumberOfCard = 2;
            target.CardsOfHand[2].NumberOfCard = 3;
            target.CardsOfHand[3].NumberOfCard = 4;
            target.CardsOfHand[4].NumberOfCard = 5;
            target.CardsOfHand[5].NumberOfCard = 1;

            target.CardsOfHand[0].TypeOfCard = "d";
            target.CardsOfHand[1].TypeOfCard = "d";
            target.CardsOfHand[2].TypeOfCard = "c";
            target.CardsOfHand[3].TypeOfCard = "t";
            target.CardsOfHand[4].TypeOfCard = "d";
            target.CardsOfHand[5].TypeOfCard = "t";
            string expected = "18 " + 5; // TODO: Initialize to an appropriate value
            string actual;
            actual = target.straight();
            Assert.AreEqual(expected, actual);
        }


        /// <summary>
        ///A test for flush
        ///</summary>
        [TestMethod()]
        [DeploymentItem("University.Workshop.Model.dll")]
        public void flushTest()
        {
            Hand_Accessor target = new Hand_Accessor(); // TODO: Initialize to an appropriate value
            target.CardsOfHand[0].NumberOfCard = 1;
            target.CardsOfHand[1].NumberOfCard = 2;
            target.CardsOfHand[2].NumberOfCard = 3;
            target.CardsOfHand[3].NumberOfCard = 4;
            target.CardsOfHand[4].NumberOfCard = 5;
            target.CardsOfHand[5].NumberOfCard = 1;

            target.CardsOfHand[0].TypeOfCard = "clover";
            target.CardsOfHand[1].TypeOfCard = "clover";
            target.CardsOfHand[2].TypeOfCard = "clover";
            target.CardsOfHand[3].TypeOfCard = "clover";
            target.CardsOfHand[4].TypeOfCard = "clover";
            target.CardsOfHand[5].TypeOfCard = "heart";
            string expected = "19 "+5; // TODO: Initialize to an appropriate value
            string actual;
            actual = target.flush();
            Assert.AreEqual(expected, actual);
        }
        /// <summary>
        ///A test for flush
        ///</summary>
        [TestMethod()]
        [DeploymentItem("University.Workshop.Model.dll")]
        public void flushTest1()
        {
            Hand_Accessor target = new Hand_Accessor(); // TODO: Initialize to an appropriate value
            target.CardsOfHand[0].NumberOfCard = 1;
            target.CardsOfHand[1].NumberOfCard = 2;
            target.CardsOfHand[2].NumberOfCard = 3;
            target.CardsOfHand[3].NumberOfCard = 4;
            target.CardsOfHand[4].NumberOfCard = 5;
            target.CardsOfHand[5].NumberOfCard = 1;

            target.CardsOfHand[0].TypeOfCard = "diamont";
            target.CardsOfHand[1].TypeOfCard = "diamont";
            target.CardsOfHand[2].TypeOfCard = "diamont";
            target.CardsOfHand[3].TypeOfCard = "diamont";
            target.CardsOfHand[4].TypeOfCard = "diamont";
            target.CardsOfHand[5].TypeOfCard = "heart";
            string expected = "19 " + 5; // TODO: Initialize to an appropriate value
            string actual;
            actual = target.flush();
            Assert.AreEqual(expected, actual);
        }
        /// <summary>
        ///A test for flush
        ///</summary>
        [TestMethod()]
        [DeploymentItem("University.Workshop.Model.dll")]
        public void flushTest2()
        {
            Hand_Accessor target = new Hand_Accessor(); // TODO: Initialize to an appropriate value
            target.CardsOfHand[0].NumberOfCard = 1;
            target.CardsOfHand[1].NumberOfCard = 2;
            target.CardsOfHand[2].NumberOfCard = 3;
            target.CardsOfHand[3].NumberOfCard = 4;
            target.CardsOfHand[4].NumberOfCard = 5;
            target.CardsOfHand[5].NumberOfCard = 1;

            target.CardsOfHand[0].TypeOfCard = "heart";
            target.CardsOfHand[1].TypeOfCard = "heart";
            target.CardsOfHand[2].TypeOfCard = "heart";
            target.CardsOfHand[3].TypeOfCard = "heart";
            target.CardsOfHand[4].TypeOfCard = "heart";
            target.CardsOfHand[5].TypeOfCard = "d";
            string expected = "19 " + 5; // TODO: Initialize to an appropriate value
            string actual;
            actual = target.flush();
            Assert.AreEqual(expected, actual);
        }
        /// <summary>
        ///A test for flush
        ///</summary>
        [TestMethod()]
        [DeploymentItem("University.Workshop.Model.dll")]
        public void flushTest3()
        {
            Hand_Accessor target = new Hand_Accessor(); // TODO: Initialize to an appropriate value
            target.CardsOfHand[0].NumberOfCard = 1;
            target.CardsOfHand[1].NumberOfCard = 2;
            target.CardsOfHand[2].NumberOfCard = 3;
            target.CardsOfHand[3].NumberOfCard = 4;
            target.CardsOfHand[4].NumberOfCard = 5;
            target.CardsOfHand[5].NumberOfCard = 1;

            target.CardsOfHand[0].TypeOfCard = "sword";
            target.CardsOfHand[1].TypeOfCard = "sword";
            target.CardsOfHand[2].TypeOfCard = "sword";
            target.CardsOfHand[3].TypeOfCard = "sword";
            target.CardsOfHand[4].TypeOfCard = "sword";
            target.CardsOfHand[5].TypeOfCard = "d";
            string expected = "19 " + 5; // TODO: Initialize to an appropriate value
            string actual;
            actual = target.flush();
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for fullHouse
        ///</summary>
        [TestMethod()]
        [DeploymentItem("University.Workshop.Model.dll")]
        public void fullHouseTest()
        {
            Hand_Accessor target = new Hand_Accessor(); // TODO: Initialize to an appropriate value
            target.CardsOfHand[0].NumberOfCard = 1;
            target.CardsOfHand[1].NumberOfCard = 1;
            target.CardsOfHand[2].NumberOfCard = 4;
            target.CardsOfHand[3].NumberOfCard = 4;
            target.CardsOfHand[4].NumberOfCard = 5;
            target.CardsOfHand[5].NumberOfCard = 1;
            target.Mayor1 = 1;
            target.Mayor2 = 4;

            target.CardsOfHand[0].TypeOfCard = "sword";
            target.CardsOfHand[1].TypeOfCard = "sword";
            target.CardsOfHand[2].TypeOfCard = "sword";
            target.CardsOfHand[3].TypeOfCard = "sword";
            target.CardsOfHand[4].TypeOfCard = "sword";
            target.CardsOfHand[5].TypeOfCard = "d";
            string expected = "20 " + 1; 
            string actual;
            actual = target.fullHouse();
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Poker
        ///</summary>
        [TestMethod()]
        public void PokerTest()
        {
            Hand target = new Hand(); // TODO: Initialize to an appropriate value
            target.CardsOfHand[0].NumberOfCard = 1;
            target.CardsOfHand[1].NumberOfCard = 1;
            target.CardsOfHand[2].NumberOfCard = 1;
            target.CardsOfHand[3].NumberOfCard = 1;
            target.CardsOfHand[4].NumberOfCard = 5;
            target.CardsOfHand[5].NumberOfCard = 12;

            target.CardsOfHand[0].TypeOfCard = "sword";
            target.CardsOfHand[1].TypeOfCard = "sword";
            target.CardsOfHand[2].TypeOfCard = "sword";
            target.CardsOfHand[3].TypeOfCard = "sword";
            target.CardsOfHand[4].TypeOfCard = "sword";
            target.CardsOfHand[5].TypeOfCard = "d";
            string expected = "21 " + 1; // TODO: Initialize to an appropriate value
            string actual;
            actual = target.Poker();
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for StraightFlush
        ///</summary>
        [TestMethod()]
        public void StraightFlushTest()
        {
            Hand target = new Hand(); // TODO: Initialize to an appropriate value
            target.CardsOfHand[0].NumberOfCard = 1;
            target.CardsOfHand[1].NumberOfCard = 2;
            target.CardsOfHand[2].NumberOfCard = 3;
            target.CardsOfHand[3].NumberOfCard = 4;
            target.CardsOfHand[4].NumberOfCard = 5;
            target.CardsOfHand[5].NumberOfCard = 12;

            target.CardsOfHand[0].TypeOfCard = "sword";
            target.CardsOfHand[1].TypeOfCard = "sword";
            target.CardsOfHand[2].TypeOfCard = "sword";
            target.CardsOfHand[3].TypeOfCard = "sword";
            target.CardsOfHand[4].TypeOfCard = "sword";
            target.CardsOfHand[5].TypeOfCard = "d";
            string expected = "22 " + 5;
            string actual;
            actual = target.StraightFlush();
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for RoyalFlush
        ///</summary>
        [TestMethod()]
        public void RoyalFlushTest()
        {
            Hand target = new Hand(); // TODO: Initialize to an appropriate value
            target.CardsOfHand[0].NumberOfCard = 10;
            target.CardsOfHand[1].NumberOfCard = 11;
            target.CardsOfHand[2].NumberOfCard = 12;
            target.CardsOfHand[3].NumberOfCard = 13;
            target.CardsOfHand[4].NumberOfCard = 14;
            target.CardsOfHand[5].NumberOfCard = 1;

            target.CardsOfHand[0].TypeOfCard = "sword";
            target.CardsOfHand[1].TypeOfCard = "sword";
            target.CardsOfHand[2].TypeOfCard = "sword";
            target.CardsOfHand[3].TypeOfCard = "sword";
            target.CardsOfHand[4].TypeOfCard = "sword";
            target.CardsOfHand[5].TypeOfCard = "d";
            string expected = "23";
            string actual;
            actual = target.RoyalFlush();
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for HandForce
        ///</summary>
        [TestMethod()]
        public void HandForceTest()
        {
            Hand target = new Hand(); // TODO: Initialize to an appropriate value
            target.Mayor1 = 11;
            target.Mayor2 = 2;
            target.CardsOfHand[0].NumberOfCard = 1;
            target.CardsOfHand[1].NumberOfCard = 11;
            target.CardsOfHand[2].NumberOfCard = 12;
            target.CardsOfHand[3].NumberOfCard = 13;
            target.CardsOfHand[4].NumberOfCard = 2;
            target.CardsOfHand[5].NumberOfCard = 3;

            target.CardsOfHand[0].TypeOfCard = "heart";
            target.CardsOfHand[1].TypeOfCard = "sword";
            target.CardsOfHand[2].TypeOfCard = "sword";
            target.CardsOfHand[3].TypeOfCard = "sword";
            target.CardsOfHand[4].TypeOfCard = "sword";
            target.CardsOfHand[5].TypeOfCard = "d";
            string expected = "11 2";
            string actual;
            actual = target.HandForce();

            Assert.AreEqual(expected, actual);
        }
    }
}
